package cn.tedu.submarine;

import javax.swing.*;

//图片类,(一个图片三步)
public class Images {

    //公开的  静态的  图片类型 变量名
    public static ImageIcon battleship1;//战舰的图片
    public static ImageIcon obsersubm;//侦查潜艇
    public static ImageIcon torpesubm;//鱼雷潜艇
    public static ImageIcon minesubm;//水雷潜艇
    public static ImageIcon mine;//鱼雷
    public static ImageIcon bomb;//深水炸弹
    public static ImageIcon sea;//背景
    public static ImageIcon gameover;//游戏结束的图片
    //第二步
    static{//初始化静态图片
        battleship1 = new ImageIcon("img/battleship.png");
        obsersubm = new ImageIcon("img/obsersubm.png");
        torpesubm = new ImageIcon("img/torpesubm.png");
        minesubm = new ImageIcon("img/minesubm.png");
        mine = new ImageIcon("img/mine1.png");
        bomb = new ImageIcon("img/bmob2.png");
        sea = new ImageIcon("img/sea.png");
        gameover = new ImageIcon("img/gameover.png");

    }
    //第三步       //返回8就读取正确,否则读取失败
    public static void main(String[] args) {
        System.out.println(battleship1.getImageLoadStatus());
        System.out.println(obsersubm.getImageLoadStatus());
        System.out.println(torpesubm.getImageLoadStatus());
        System.out.println(minesubm.getImageLoadStatus());
        System.out.println(mine.getImageLoadStatus());
        System.out.println(bomb.getImageLoadStatus());
        System.out.println(sea.getImageLoadStatus());
        System.out.println(gameover.getImageLoadStatus());
    }
}
